Skip to content

fix(chart-legend): avoid undefined type by using value#1749

Open
linzhe141 wants to merge 3 commits intounovue:devfrom
linzhe141:fix-1
Open

fix(chart-legend): avoid undefined type by using value#1749
linzhe141 wants to merge 3 commits intounovue:devfrom
linzhe141:fix-1

Conversation

@linzhe141
Copy link
Copy Markdown

@linzhe141 linzhe141 commented Apr 2, 2026

🔗 Linked issue

#1748

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Resolves #1748

📸 Screenshots (if appropriate)

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • Refactor
    • Streamlined how chart legend items are prepared for display to make rendering logic clearer.
  • Bug Fixes
    • Ensured legend icons and labels render consistently, reducing cases of missing or mismatched item details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37dd335c-8b80-464b-b913-86c32ea7e828

📥 Commits

Reviewing files that changed from the base of the PR and between 53c0cd9 and 717108a.

📒 Files selected for processing (1)
  • apps/v4/registry/new-york-v4/ui/chart/ChartLegendContent.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/v4/registry/new-york-v4/ui/chart/ChartLegendContent.vue

📝 Walkthrough

Walkthrough

Computed payload in ChartLegendContent.vue now assigns itemConfig directly from each Object.entries(config.value) iteration; template bindings were changed from optional chaining to direct property access (itemConfig.icon, itemConfig.label) and color remains optionally accessed.

Changes

Cohort / File(s) Summary
Chart Legend Configuration
apps/v4/registry/new-york-v4/ui/chart/ChartLegendContent.vue
Compute payload by assigning itemConfig to the iterated value (no re-indexing via config.value[key]); template switched from itemConfig?.icon/?.label to itemConfig.icon/itemConfig.label, while color binding keeps optional access.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through entries, neat and spry,
Took one direct bite, no double-try.
Icons stand tall, labels sing clear,
Types nod softly — nothing to fear. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(chart-legend): avoid undefined type by using value' accurately reflects the main change: fixing a TypeScript type error in the chart legend by using the destructured value directly instead of re-indexing.
Linked Issues check ✅ Passed The PR successfully addresses issue #1748 by fixing the TypeScript error in ChartLegendContent through proper variable usage and optional chaining adjustments, resolving the type error reported by the Vue extension.
Out of Scope Changes check ✅ Passed All changes are scoped to the ChartLegendContent.vue file and directly address the TypeScript typing issue described in issue #1748; no extraneous modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ChartLegendContent typescript error

1 participant